import httpRequest from '@/request'
import appConfig from '@/config/index'

// 设备树
export function deviceTree () {
  return httpRequest({
    url: `${appConfig.api}project/devicetree`,
    method: 'post'
  })
}

// 设备列表
export function deviceListPage (params: any) {
  return httpRequest({
    url: `${appConfig.api}device/search`,
    method: 'post',
    data: params
  })
}

// 新增设备
export function deviceInsert (params: any) {
  return httpRequest({
    url: `${appConfig.api}device/create`,
    method: 'post',
    data: params
  })
}

// 编辑设备
export function deviceUpdate (params: any) {
  return httpRequest({
    url: `${appConfig.api}device/update`,
    method: 'post',
    data: params
  })
}

// 删除设备
export function deviceDelete (params: any) {
  return httpRequest({
    url: `${appConfig.api}device/delete`,
    method: 'post',
    data: params
  })
}
